﻿#pragma once

#include <functional>
#include <queue>
#include <random>
#include <vector>

#include <xy/geom/vec.h>

namespace xy
{

namespace alg
{

struct poisson_disk_sampler
{
    // 密度函数
    std::function<double(geom::vec2)> dense{[](geom::vec2) { return 1.0; }};
    std::size_t newPointCount{30};

    /**
     * @brief 参数域采样
     *
     * @param[in] uFirst
     * @param[in] uLast
     * @param[in] vFirst
     * @param[in] vLast
     * @return std::vector<geom::vec2>
     */
    std::vector<geom::vec2> perform(double uFirst, double uLast, double vFirst, double vLast) const;
};

} // namespace alg

} // namespace xy
